package com.changli01.string;

import org.junit.Test;

public class StringTest {
    public static void main(String[] args) {
        String s0 =new String("world") ;
        String s1 = "hello";
        String s2 = "hello";
        String s3= new String ("hello");


        System.out.println(s1==s2); // true
        System.out.println(s1==s3);//  false

        System.out.println("******************");
        String s4 = "world";
        String s00 ="helloworld" ;

        String s5= s1 + s4; //helloworld
        System.out.println(s5);
        String s6= s1 + s0;
        String s7= s3 + s4;
        String s8= s3 + s0;


        System.out.println(s00 == s5); //true
        System.out.println(s00 == s6);//false
        System.out.println(s00 == s7);// false
        System.out.println(s00 == s8);// false
        System.out.println(s6 == s5);//false
        System.out.println(s8 == s7); //false
    }

}
